package cn.silver.module.configuration.bean;

import cn.silver.framework.core.utils.DateUtils;
import cn.silver.framework.core.validate.AddGroup;
import cn.silver.framework.core.validate.EditGroup;
import cn.silver.framework.excel.convert.ExcelDictConvert;
import cn.silver.framework.mybatis.bean.BusBean;
import cn.silver.module.configuration.domain.SysParam;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.github.linpeilie.annotations.AutoMapper;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;


/**
 * 参数配置视图对象 sys_config
 *
 * @author Silver Zhou
 */
@Data
@NoArgsConstructor
@ExcelIgnoreUnannotated
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = SysParam.class)
@Schema(name = "ParamBean", title = "参数配置对象")
public class ParamBean extends BusBean implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 参数键值
     */
    @Schema(title = "参数值")
    @ExcelProperty(value = "参数值")
    @NotBlank(message = "参数值不能为空", groups = {AddGroup.class, EditGroup.class})
    private String value;

    /**
     * 系统内置（Y是 N否）
     */
    @Schema(title = "系统内置")
    @ExcelProperty(value = "系统内置", converter = ExcelDictConvert.class)
    @NotBlank(message = "系统内置不能为空", groups = {AddGroup.class, EditGroup.class})
    private Boolean built;

}
